using System;
using System.Windows.Forms;

namespace ShadeTree.Binding.Drivers
{
    public static class ControlDriverFactory
    {
        public static IControlDriver GetDriver(object control)
        {
            if (control == null)
            {
                return null;
            }

            if (control is Control)
            {
                return new WinFormsControlDriver((Control) control);
            }

            if (control is System.Windows.Controls.Control)
            {
                return new WPFControlDriver((System.Windows.Controls.Control) control);
            }


            throw new NotImplementedException();
        }
    }
}